package com.home.auto_navigation.ui.pages;

import java.util.HashMap;
import java.util.Map;

import org.openqa.selenium.NoSuchElementException;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.PageFactory;

import com.home.auto_navigation.common.AutoNavigationFileDecorator;
import com.home.auto_navigation.ui.AbstractPageObject;
import com.home.auto_navigation.ui.controllers.Button;

public class JavaEEPage extends AbstractPageObject {
    
    @FindBy(xpath = "//div[@class='orcl6w3']/h1[text()='Java EE 7 SDK Downloads']")
    private WebElement uniqueElement;
    
    public JavaEEPage() {
	PageFactory.initElements(new AutoNavigationFileDecorator(getDriver()), this);
	this.successors = new HashMap<Class<? extends AbstractPageObject>, Button>();
	//this.successor.put(JavaHubsPage.class, javaHubs);
    }
    
    @Override
    public boolean isExist() {
	try{
		return uniqueElement.isDisplayed();
	}catch(NoSuchElementException e){
	    return false;
	}
    }

    @Override
    public void invokeSuccessor(Map<String, String> businessData,
	    Class<? extends AbstractPageObject> page) {
	// TODO Auto-generated method stub
	
    }

}
